package com.mybatis.demo.plugin;

import lombok.Data;

/**
 * @author zp
 * @version 1.0
 * @description: 分页对象
 * @date 2022/11/24 20:02
 */
@Data
public class Page {
    private int total;
    private int size;
    private int index;

    public int getOffset() throws Exception{
        if(index<1){
            throw new Exception("index 参数异常 设置的值[ "+index + " ]");
        }
        return size * (index - 1);
    }
}
